package com.zyy.smartcity1129.violation;

import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Spinner;

import com.zyy.smartcity1129.BaseFragment;
import com.zyy.smartcity1129.R;

/**
 * @ClassName: ViolationFragment$
 * @Description: 作用
 * @Author: letquit
 * @CreateDate: 7/12/2021$
 * @Version: 1.0
 */
public class ViolationFragment extends BaseFragment {
    private Spinner spVio;
    private EditText editVio;
    private Button btnVio;
    public static String carNum;

    @Override
    protected int layId() {
        return R.layout.f_violation;
    }

    @Override
    protected String title() {
        return "违章查询";
    }

    @Override
    protected boolean back() {
        return true;
    }

    @Override
    protected Boolean bottom() {
        return null;
    }

    @Override
    protected void init(View iv) {
        initView(iv);
        btnVio.setOnClickListener(view -> {
            String s = spVio.getSelectedItem().toString();
            String e = editVio.getText().toString().trim();
            carNum = s + " " + e;
            add(new ViolationRecordFragment());
        });
    }

    private void initView(View iv) {
        spVio = (Spinner) iv.findViewById(R.id.spVio);
        editVio = (EditText) iv.findViewById(R.id.editVio);
        btnVio = (Button) iv.findViewById(R.id.btnVio);
    }
}
